<template>
  <div id="app">
    <canvas id="canvas"></canvas>
  </div>
</template>

<script>
import { ApiArCamera, ApiArKnow } from "api_web_ar";
export default {
  name: "App",
  async created() {
    /* 开启摄像头 */
    let apiArCamera = await ApiArCamera(window.innerWidth, window.innerHeight);
    let apiArKnow = await ApiArKnow({
      koneType: "nft",
      markerUrl: "./nft/smoking_boy",
      cameraPara: "./resource/camera_para.dat",
      cameraOrigin: apiArCamera,
      three3d: false,
    });
    apiArKnow.on("loaded", () => {
      console.log("加载完成");
    });
    apiArKnow.on("found", () => {
      // console.log("识别到图片");
    });
    apiArKnow.on("notFound", () => {
      // console.log("未识别到图片");
    });
  },
};
</script>

<style>
#canvas {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 100vw !important;
  height: 100vh !important;
}
</style>
